﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;

namespace Stockholm.SOA.Kaskelot.WCF.DataContracts
{
	[DataContract(Namespace = "http://stockholm.se/SOA/Kaskelot/KaskelotService/1/", Name = "KursTillfalle")]
	public class KursTillfalle
	{
		[DataMember]
		public Guid Id { get; set; }
		[DataMember]
		public Guid ValId { get; set; }
		[DataMember]
		public DateTime Skapad { get; set; }
		[DataMember]
		public string SkapadAv { get; set; }
		[DataMember]
		public DateTime? Andrad { get; set; }
		[DataMember]
		public string AndradAv { get; set; }
		[DataMember]
		public DateTime Kursdatum { get; set; }
		[DataMember]
		public TimeSpan Starttid { get; set; }
		[DataMember]
		public TimeSpan Sluttid { get; set; }
		[DataMember]
		public string Adress { get; set; }
		[DataMember]
		public string Sal { get; set; }
		[DataMember]
		public Guid KursId { get; set; }
		[DataMember]
		public string KursNamn { get; set; }
		[DataMember]
		public string LedigaPlatser { get; set; }
		[DataMember]
		public Guid? Kursansvarig { get; set; }
		[DataMember]
		public string KursansvarigNamn { get; set; }
		[DataMember]
		public string Lokal { get; set; }

		public string DatumText
		{
			get { return this.Kursdatum.ToString("yyyy-MM-dd"); } 
		}

		public string StartText
		{
			get { return this.Starttid.Hours + ":" + this.Starttid.Minutes.ToString().PadLeft(2, '0'); }
		}

		public string SlutText
		{
			get { return this.Sluttid.Hours + ":" + this.Sluttid.Minutes.ToString().PadLeft(2, '0'); }
		}
	}
}
